package com.itheima.api.map.demo06;

import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;

public class MapTraverseDemo_3 {

    public static void main(String[] args) {

        Map<String, String> map = new HashMap<>();
        map.put("蓝湛", "蓝忘机");
        map.put("魏婴", "魏无羡");
        map.put("蓝涣", "蓝曦臣");
        System.out.println(map);

        map.forEach(new BiConsumer<String, String>() {
            @Override
            public void accept(String s, String s2) {
                System.out.println(s + "-1-" + s2);
            }
        });

        map.forEach((String key, String value) -> {
            System.out.println(key + "-2-" + value);
        });
    }
}
